<template>
	<view class="find-base-content">
		<view class="pic-content">
			<view class="avatar">
				<image class="avatar-img" :src="dealImage()">
				</image>
			</view>
			<view class="info">
				<view class="info-item">
					<view class="labal">编号：</view>
					<view class="value">{{userInfo.num}}</view>
				</view>
				<view class="info-item">
					<view class="labal">年龄：</view>
					<view class="value" style="display: flex; justify-content: space-between;">
						<view>
							{{getAge(userInfo.baseInfo.age)}}
						</view>
						<view><text class="marry" :class="userInfo.baseInfo.sex == 1?' marry-a-06nanxingjiaose'
							:' marry-a-18nvxingjiaose'"></text></view>
					</view>
				</view>
				<view class="info-item">
					<view class="labal">身高：</view>
					<view class="value">
						<text>{{userInfo.baseInfo.height}} 厘米</text>
					</view>
				</view>
				<view class="info-item">
					<view class="labal">体重：</view>
					<view class="value">
						<text>{{userInfo.baseInfo.kg}} 公斤</text>
					</view>
				</view>
				<view class="info-item">
					<view class="labal">目前状况：</view>
					<view class="value">{{keyValue("marryHistryItem",userInfo.baseInfo.currnetMarryHistry)}}</view>
				</view>
			</view>
		</view>
		<view class="body-info">
			<view class="unisection">
				<view></view>
				<view>基本信息</view>
			</view>
			<uni-row class="marry-row">
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal tow-font">学历</view>
						<view class="value">：{{keyValue("shcoolList",userInfo.baseInfo.education)}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal tow-font">职位</view>
						<view class="value">：{{keyValue("staffList",userInfo.baseInfo.staff)}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal">工作性质：</view>
						<view class="value">{{keyValue("staffxzList",userInfo.baseInfo.staffxz)}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal three-font">年收入</view>
						<view class="value">：{{userInfo.baseInfo.incoom}} 万</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal">五险一金：</view>
						<view class="value">{{keyValue("noHave",userInfo.baseInfo.haveinsure)}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal">有无房子：</view>
						<view class="value">{{keyValue("noHave",userInfo.baseInfo.havehouse)}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal">有无车子：</view>
						<view class="value">{{keyValue("noHave",userInfo.baseInfo.haveCar)}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal">有无贷款：</view>
						<view class="value">
							{{keyValue("noHave",userInfo.baseInfo.havehouseMoney)}}
						</view>
					</view>
				</uni-col>
				<uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
					<view class="info-item">
						<view class="labal">出生地址：</view>
						<view class="value">
							{{dealAdress(userInfo.baseInfo,"adress")}}

						</view>
					</view>
					<view class="info-item">
						<view class="labal">工作地址：</view>
						<view class="value">
							{{dealAdress(userInfo.baseInfo,"workAdress")}}
						</view>
					</view>
					<view class="info-item">
						<view class="labal">自我介绍：</view>
						<view class="value">
							{{userInfo.baseInfo.selfdesc}}
						</view>
					</view>
				</uni-col>
			</uni-row>
			<view class="unisection">
				<view></view>
				<view>征婚信息</view>
			</view>
			<uni-row class="marry-row">
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">期望年龄 ：</view>
						<view class="value">{{userInfo.others.age}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">年龄范围</view>
						<view class="value">：{{userInfo.others.minAge}} ~{{userInfo.others.maxAge}}</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6" v-if="userInfo.others.height">
					<view class="info-item">
						<view class=" tow-font">身高</view>
						<view class="value">
							<text>：{{userInfo.others.height}} 厘米</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal tow-font">体重</view>
						<view class="value">
							<text>：{{userInfo.others.kg}} 公斤</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(keyValue('noHave',userInfo.others.face))&&userInfo.others.face">
					<view class="info-item">
						<view class="labal three-font">高颜值</view>
						<view class="value">
							<text>：{{keyValue('noHave',userInfo.others.face)}} </text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">要求学历：</view>
						<view class="value">
							<text>{{keyValue('shcoolList',userInfo.others.education)}} </text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">婚姻要求：</view>
						<view class="value">
							<text>{{keyValue('marryHistryItem',userInfo.others.needMarry)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">是否要孩子：</view>
						<view class="value">
							<text>{{keyValue('needchildList',userInfo.others.needChild)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">房屋要求：</view>
						<view class="value">
							<text>{{keyValue('houseList',userInfo.others.needHouse)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(keyValue('noHave',userInfo.others.needCar))&&userInfo.others.needCar">
					<view class="info-item">
						<view class="labal ">车辆要求：</view>
						<view class="value">
							<text>{{keyValue('noHave',userInfo.others.needCar)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6">
					<view class="info-item">
						<view class="labal ">车辆要求：</view>
						<view class="value">
							<text>{{keyValue('noHave',userInfo.others.needCar)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(userInfo.others.incoom)&&userInfo.others.incoom">
					<view class="info-item">
						<view class="labal three-font">年收入：</view>
						<view class="value">{{userInfo.others.incoom}} 万</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(keyValue('noHave',userInfo.others.haveHouseMoney))&&userInfo.others.haveHouseMoney">
					<view class="info-item">
						<view class="labal ">有无贷款：</view>
						<view class="value">
							<text>{{keyValue('noHave',userInfo.others.haveHouseMoney)}} </text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
					<view class="info-item">
						<view class="labal ">期望描述：</view>
						<view class="value">
							<text>{{userInfo.others.hopeDes}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(keyValue('noHave',userInfo.others.needInsure))&&userInfo.others.needInsure">
					>
					<view class="info-item">
						<view class="labal ">是否有保险：</view>
						<view class="value">
							<text>{{keyValue('noHave',userInfo.others.needInsure)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(keyValue('homeAreaList',userInfo.others.homeArea))&&userInfo.others.homeArea">
					<view class="info-item">
						<view class="labal ">老家范围：</view>
						<view class="value">
							<text>{{keyValue('homeAreaList',userInfo.others.homeArea)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="12" :sm="12" :md="8" :lg="6" :xl="6"
					v-if="!['无','不限','无要求',''].includes(keyValue('homedescList',userInfo.others.needHomeDesc))&&userInfo.others.needHomeDesc">
					<view class="info-item">
						<view class="labal ">家庭要求：</view>
						<view class="value">
							<text>{{keyValue('homedescList',userInfo.others.needHomeDesc)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="userInfo.others.needHomeDescExite">
					<view class="info-item">
						<view class="labal ">对家庭要求补充：</view>
						<view class="value">
							<text>{{userInfo.others.needHomeDescExite}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"
					v-if="!['无','不限','无要求',''].includes(keyValue('jobList',userInfo.others.dontLikeJob))&&userInfo.others.dontLikeJob">
					<view class="info-item">
						<view class="labal ">不喜欢的职业：</view>
						<view class="value">
							<text>{{keyValue('jobList',userInfo.others.dontLikeJob)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
					<view class="info-item">
						<view class="labal ">不喜欢工作性质：</view>
						<view class="value">
							<text>{{keyValue('jobxzList',userInfo.others.dontLikeJobxz)}}</text>
						</view>
					</view>
				</uni-col>
				<uni-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" v-if="userInfo.others.dontLikeBehavior">
					<view class="info-item">
						<view class="labal ">不喜欢的行为：</view>
						<view class="value">
							<text>{{userInfo.others.dontLikeBehavior}}</text>
						</view>
					</view>
				</uni-col>
			</uni-row>
		</view>

	</view>
</template>


<script setup lang="ts">
	import { ref } from 'vue';
	import { useUserStore } from '@/stores/user.js';
	import { keyValue, getZodiac, getAge } from "@/utils/common.js"
	import emun from '@/utils';
	const noHave = ref(emun.noHave)
	const sexs = ref(emun.sexs)
	const marryHistryItem = ref(emun.marryHistryItem)
	const houseList = ref(emun.noHave)
	const shcoolList = ref(emun.shcoolList)
	const staffxzList = ref(emun.staffxzList)
	const staffList = ref(emun.staffList)

	const userStore = useUserStore();
	const userInfo = ref(userStore.currentUserInfo)
	console.log(userInfo)
	const dealImage = () => {
		let tem = '@/uni_modules/uni-id-pages/static/login/uni-fab-login/sms.png'
		if (userInfo.value.picObj.pictures && userInfo.value.picObj.pictures.length > 0) {
			tem = userInfo.value.picObj.pictures[0].url
		}
		return tem
	}
	const dealAdress = (item, type) => {
		let ad = '暂无地址'
		if (type == 'adress' && item.adressList && item.adressList.length > 0) {
			let newarr = item.adressList.slice(0, item.adressList.length - 2)
			if (newarr.length > 0) {
				ad = ((newarr.map((it) => it.text)).toString()).replace(/,/g, "/");
			}
		} else if (type = 'workAdress' && item.workAdressList && item.workAdressList.length > 0) {
			let newarr = item.workAdressList.slice(0, item.workAdressList.length - 2)
			if (newarr.length > 0) {
				ad = ((newarr.map((it) => it.text)).toString()).replace(/,/g, "/");
			}
		} else if (type = 'workAdress' && item.adressList && (item.workAdressList.length == 0 || !item.workAdressList)) {
			let newarr = item.adressList.slice(0, item.adressList.length - 2)
			if (newarr.length > 0) {
				ad = ((newarr.map((it) => it.text)).toString()).replace(/,/g, "/");
			}
		}
		return ad
	}
</script>

<style lang="scss" scoped>
	.find-base-content {
		padding-bottom: 20px;

		.pic-content {
			display: flex;

			.avatar {
				height: 239px;
				width: 208px;
				padding: 10px;

				.avatar-img {
					height: 100%;
					width: 100%;
				}
			}

			.info {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: center;
				line-height: 36px;
			}

		}

		.info-item {
			display: flex;

			.marry {
				margin-left: 8px;
			}
		}

		.marry-row {
			padding: 0 8px;
		}

		.unisection {
			position: relative;
			display: flex;
			flex-direction: row;
			align-items: center;
			padding: 12px 10px;
			font-weight: normal;
			font-size: 28rpx;
			background: #eee;
			margin-bottom: 20px;
			padding-left: 8rpx;

		}

		.body-info {
			line-height: 31px;

			.tow-font {
				letter-spacing: 31px;
				margin-right: -31px;
			}

			.three-font {
				letter-spacing: 8px;
				margin-right: -16px;
			}

			.labal {
				min-width: 80px;
			}
		}
	}
</style>